/*************************************************************************
	> File Name: P1855.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-04-16 18:15:44
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

#define MAX_N 200
int dp[MAX_N + 5][MAX_N + 5];

int main() {
    int n, M, T;
    cin >> n >> M >> T;
    for (int i = 0, m, t; i < n; i++) {
        cin >> m >> t;
        for (int j = M; j >= m; j--) {
            for (int k = T; k >= t; k--) {
                dp[j][k] = max(dp[j][k], dp[j - m][k - t] + 1);
            }
        }
    }
    cout << dp[M][T] << endl;
    return 0;
}
